package com.shujia.wyh.day14;

import java.net.InetAddress;

/*
    通过观察发现InetAddress类没有构造方法，那如何去使用呢？
    static InetAddress getByName(String host) 确定主机名称的IP地址。
 */
public class InetAddressDemo1 {
    public static void main(String[] args) throws Exception {
        InetAddress inetAddress = InetAddress.getByName("192.168.6.80");
//        System.out.println(inetAddress);
        String hostAddress = inetAddress.getHostAddress();
//        System.out.println(hostAddress);
        String hostName = inetAddress.getHostName();
        System.out.println(hostName);
    }
}
